﻿using System;
using Zeus.Thunder.Core;
using CsharpTrainer.MongoDB.Model;
using CsharpTrainer.MongoDB.DAL;

namespace SharpTrainer.MongoDB
{
    class MongoAddTest : ITestCase
    {
        public void Run()
        {
            MongodbHelper<CsharpTrainer.MongoDB.Model.Person> helper = new MongodbHelper<CsharpTrainer.MongoDB.Model.Person>();

            //插入1000条数据
            for (int i = 0; i < 1000; i++)
            {
                helper.Insert(new CsharpTrainer.MongoDB.Model.Person()
                {
                    ID = Guid.NewGuid().ToString(),
                    Name = "kelvin" + i,
                    Age = i,
                    CreateTime = DateTime.Now
                });
            }

            Console.WriteLine("插入成功");

        }
    }
}
